Method for generating a personalized classifier for human motion activities of a mobile or wearable device user with unsupervised learning

ABSTRACT

Described herein is a method of operating an electronic device that includes collecting initial motion activity data from at least one sensor of the electronic device, and generating a initial probabilistic context of the electronic device relative to its surroundings from the initial collected motion activity data using a motion activity classifier function. The collected motion activity data is stored in a training data set, and the motion activity classifier function is updated using the training data set. The method also includes collecting subsequent motion activity data from the at least one sensor of the electronic device, and generating a subsequent probabilistic context of the electronic device relative to its surroundings from the subsequently collected motion activity data using the updated motion activity classifier function.

TECHNICAL FIELD

This disclosure relates to a method for improving classificationaccuracy of a mobile or wearable device user's motion activities using aclassifier that is personalized, starting from a factory-set generalizedclassifier, in an unsupervised manner.

BACKGROUND

Mobile, tablet, and wearable devices include embedded MEMS sensors likeaccelerometers, barometers, gyroscopes, magnetometers, and microphones.These sensors can be used by software executed within the device todetermine the human motion activity being performed or undertaken by theuser. The detection of such motion activities can be used by software toassist with human-machine interaction. Indeed, motion activity awaredevices may minimize or even eliminate the need for human input incertain applications involving motion activities. For example, anapplication may, if the human user is jogging, automatically and withoutthe need for user input, start playing music and switch on healthmonitoring applications. Thus, the correct detection of human motionactivities may be valuable and commercially desirable, particularly inthe domains of ubiquitous computing, human machine interaction, and theinternet of things.

Typically, such electronic devices use generalized classificationtechniques to determine which motion activity, such as walking orjogging, is being performed. These generalized classification techniquesare not specific to any one user, and are instead designed to provideacceptable performance for any user. However, each person has adifferent gait when performing such motion activities, meaning that thegeneralized classification techniques may be more accurate for certainusers than for other users. This is compounded by the large differencesin human size, shape, and weight, as sensor output for a jogging motionperformed by a tall and heavy individual may be substantially differentthan sensor output for a jogging motion performed by a short and lightindividual, for example.

Therefore, to provide for better and more accurate motion activitydetection and classification, the development of classificationtechniques that can take into account the different characteristics ofdifferent users is needed.

SUMMARY

A method is for operating an electronic device and includes collectinginitial motion activity data from at least one sensor of the electronicdevice, and generating a initial probabilistic context of the electronicdevice relative to its surroundings from the initial collected motionactivity data using a motion activity classifier function. The collectedmotion activity data is stored in a training data set, and the motionactivity classifier function is updated using the training data set. Themethod also includes collecting subsequent motion activity data from theat least one sensor of the electronic device, and generating asubsequent probabilistic context of the electronic device relative toits surroundings from the subsequently collected motion activity datausing the updated motion activity classifier function.

The method may include generating a data selection confidence measureafter generating the initial probabilistic context. The collected motionactivity data may be stored in the training data set if the dataselection confidence measure is greater than a lower threshold, and thecollection motion activity data may not be stored in the training dataset if the data selection confidence measure is less than the lowerthreshold.

The collected motion activity data may be stored in the training dataset if the data selection confidence measure is greater than or equal toa lower threshold and less than or equal to an upper threshold.

The method may include generating a data selection confidence measureafter generating the initial probabilistic context. The collected motionactivity data may be stored in the training data set if the dataselection confidence measure is less than an upper threshold, and thecollection motion activity data is not stored in the training data setif the data selection confidence measure is greater than the upperthreshold.

The method may also include determining whether the training data setcontains sufficient data prior to updating the motion activityclassifier function using the training data set, and not updating themotion activity classifier function unless the training data setcontains sufficient data.

The method may additionally include storing the subsequent motionactivity data in the training data set, further updating the updatedmotion activity classifier function using the training data set,collecting further motion activity data from the at least one sensor ofthe electronic device, and generating a further probabilistic context ofthe electronic device relative to its surroundings from the furthermotion activity data using the further updated motion activityclassifier function.

The data selection confidence measure may based upon conditional entropyof the initial probabilistic context. The initial probabilistic contextmay include a motion activity posteriorgram encompassing multipledifferent potential contexts, and the data selection confidence measuremay be based upon conditional entropy of the motion activityposteriorgram.

The data selection confidence measure may be based upon a differencebetween highest and second highest of posterior probabilities of motionactivities of the probabilistic context. The training data set mayinclude generalized data and motion activity data collected from the atleast one sensor of the electronic device.

The training data set may consist or consist essentially of motionactivity data collected from the at least one sensor of the electronicdevice.

Also described herein is a sensor chip mounted on a printed circuitboard (PCB) and electrically coupled to a system on chip (SOC) mountedon the PCB via at least one conductive trace. The sensor chip includesat least one sensing device and a control circuit. The control circuitis configured to collect initial motion activity data from the at leastone sensing device, generate a initial probabilistic context of theprinted circuit board relative to its surroundings from the initialcollected motion activity data using a motion activity classifierfunction, store the collected motion activity data in a training dataset, update the motion activity classifier function using the trainingdata set, collect subsequent motion activity data from the at least onesensor of the electronic device, and generate a subsequent probabilisticcontext of the electronic device relative to its surroundings from thesubsequently collected motion activity data using the updated motionactivity classifier function.

The control circuit may output the initial probabilistic context andsubsequent probabilistic context to the SOC.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1A is a block diagram of a device capable of implementing themethods and techniques described herein in which the personalizedclassifier is stored in nonvolatile memory.

FIG. 1B is a block diagram of a device capable of implementing themethods and techniques described herein in which the personalizedclassifier is stored on an external server.

FIG. 1C is a block diagram of an alternative device capable ofimplementing the methods and techniques described herein in which thepersonalized classifier is stored in nonvolatile memory.

FIG. 2 includes graphs depicting target user data being incorrectlyclassified with the use of a generalized classifier, and correctlyclassified with the use of personalized classifier.

FIG. 3 is a flowchart of a method of generating a personalizedclassifier of human motion activity of a mobile or wearable device userfrom a generalized classifier using unsupervised learning.

FIG. 4 is a flowchart of a method for iteratively generating apersonalized classifier of human motion activity of a mobile or wearabledevice user from a previous personalized classifier using unsupervisedlearning.

FIG. 5 is a flowchart showing details of the generation of the motionactivity posteriorgram and detection of motion activity in FIGS. 3-4.

FIG. 6 includes graphs showing posterior probabilities for the motionactivity classes in the form of a motion activity posteriorgram (MAP) asa function of frames, and conditional entropy being used for a DSMdetermined from the MAP for the activity “walking”.

FIG. 7 includes graphs showing posterior probabilities for the motionactivity classes in the form of a MAP as a function of frames, and adifference between the highest and second highest posteriorprobabilities being used for the DSM determined from the MAP for theactivity “walking”.

FIG. 8 includes graphs showing a MAP obtained using a generalizedclassifier with the activity “walking” being performed, a conditionalentropy calculated as a measure of the DSM, and a MAP obtained usingpersonalized classifier with the activity “walking” being performed.

FIG. 9 is a chart showing a weighted accuracy for different carrypositions of the device using a generalized classifier and apersonalized classifier trained with data having a conditional entropygreater than a lower threshold and less than an upper threshold.

FIG. 10 is a graph showing a weighted average accuracy of personalizedand generalized motion activity detection for a device positioned in atrouser pocket.

FIG. 11 is a graph showing a weighted average accuracy of personalizedand generalized motion activity detection for a device in positioned ina backpack.

FIG. 12 is a graph showing a weighted average accuracy of personalizedand generalized motion activity detection for a device positioned inhand.

FIG. 13 is a graph showing a weighted average accuracy of personalizedand generalized motion activity detection for a device carried by an armthat is swinging.

FIG. 14 is a graph showing a weighted average accuracy of personalizedand generalized motion activity detection for a device in a shirtpocket.

FIG. 15 is a graph showing a weighted average accuracy of personalizedand generalized motion activity detection for a device in a holster.

FIG. 16 is a graph showing a weighted average accuracy of personalizedand generalized motion activity detection for a device in a shoulderbag.

DETAILED DESCRIPTION

The present description is made with reference to the accompanyingdrawings, in which example embodiments are shown. However, manydifferent embodiments may be used, and thus the description should notbe construed as limited to the embodiments set forth herein. Rather,these embodiments are provided so that this disclosure will be thoroughand complete. Like numbers refer to like elements throughout.

Operation in accordance with this disclosure will first be explained ingeneral, and thereafter will be described in greater detail.

Described herein is a computational method for determining a mobile orwearable device user's motion activity with one or more sensors, withthe objective of achieving an improved level of accuracy, by inductingsamples of motion activity of target user into a factory-set generalizeddataset to provide a training data set. The target user's data beinginducted in the factory-set generalized dataset is dependent on a dataselection measure (DSM) of a posterior probability classifier. The DSMis a measure of confidence in the classifier's detected activity that isbased on the posterior probabilities of the different motion activities.Using the training data set, a factory-set generalized posteriorprobability classifier can be migrated to a personalized posteriorprobability classifier specific for the target user.

This method allows for flexibility in the range of the DSM based uponwhich the sample data of motion activities of the target user may beinducted in to training dataset. A computational architecture describedherein provides the output of the detected motion activity, throughheterogeneous sensor measurements and the personalized classifier. Themigration from the factory-set generalized classifier to the targetuser-specific personalized classifier is effective when a sufficient orsignificant amount of target user's data within the pre-specified rangeof the DSM is available.

The personalized classifier may be of two types: either a personalizedclassifier containing a generalized dataset as well as motion activitylabeled data from the target user, or a personalized classifiercontaining motion activity labeled data from the target user only. Theoutput of the personalized classifier is in the form of the detectedmotion activity output periodically, and that is derived from theprobability of each motion activity class obtained by the classifier,based upon the data collected from the sensor(s).

Motion activities may be detected using one or more of theaforementioned sensors. To sense motion activity, under a supervisedlearning approach, a generalized dataset or generalized classifier,which may be factory set, may be provided. The generalized datasetincludes data from other human subjects that is different from thetarget user's data, and is used for training the generalized classifierfor detecting motion activities.

The pattern of motion activities as recorded on sensor(s) are generallyperson specific as these depend on height, weight, gender, age of theperson, in addition to personal style of performing the activities. Thecommon motion activities that have personalized characteristics arewalking, cycling, going upstairs, going downstairs, and jogging. Also,as mobile and wearable devices are personal devices of a user, theoption of designing and using a personalized classier is available. As aresult, a person dependent classifier trained on the target user'smotion activity patterns will detect motion activities more accurately.Even though a target user specific classifier designed using the user'smotion activity data would be more accurate, designing a classifier foreach target user by explicitly enquiring for the samples of each motionactivity from the target user is impractical. Thus, a personalizedclassifier is sought which does not explicitly request from the userdata samples of each motion activity to build the personalizedclassifier. The personalized classifier may have the advantage ofincreased accuracy as it would be able to detect and classify accordingto the target user's motion activity patterns.

With initial reference to FIG. 1A, an electronic device 50 upon whichthe various techniques and methods of this disclosure may be performedis now described. The electronic device 50 may be a smartphone, tablet,smartwatch, or other wearable device that is carried by, or worn by, auser 10. The electronic device 50 includes a printed circuit board (PCB)99 having various components mounted thereon. Conductive traces 69printed on the PCB 99 serve to electrically couple the variouscomponents together in a desired fashion.

A system on chip (SOC) 70, which comprises a central processing unit(CPU) 72 coupled to a graphics processing unit (GPU) 74, is mounted onthe PCB 99. Also coupled to the CPU 72 is random access memory (RAM) 76and a transceiver (XCVR) 75 via which the SOC 70 can communicate withremote servers over the Internet. A touch sensitive display 78 iscoupled to the SOC 70, and is used by the SOC 70 to display output andreceive input. A variety of sensors are coupled to the SOC 70, includinga magnetometer 68 used to determine the orientation of the electronicdevice 50 with respect to the magnetic field of the Earth, a gyroscope62 used to determining an orientation of the electronic device 50 withrespect to the environment, and a microphone 65 used to detect audiblenoises in the environment. A configurable sensor unit 60 is mounted onthe PCB 99 spaced apart from the SOC 70, and coupled thereto by theconductive traces 69. For illustrative purposes only, for example, theconfigurable sensor unit 70 includes an accelerometer 63 and/orbarometer 67 packaged in a MEMS sensing unit 61 and coupled to a controlcircuit 62. The accelerometer 63 is used for determining accelerationsexperienced by the electronic device 50, and the barometer 67 used todetermine the air pressure in the environment (and thus, the altitude ofthe electronic device 50).

It should be understood that any now existing or future developed typeof sensors could be used with this disclosure, the scope of which is notlimited by the type of configurable sensors used. The configurablesensor unit 60 may be formed from discrete components and/or integratedcomponents and/or a combination of discrete components and integratedcomponents, and may be formed as a package.

As illustrated in FIG. 1A as an example, the configurable sensor unit 60is not a portion of the SOC 70, and is a separate and distinct componentfrom the SOC 70. The sensor unit 60 and the SOC 70 are separate,distinct, mutually exclusive chips mounted on the PCB 99 at differentlocations and coupled together via the conductive traces 69. It shouldbe understood that this example configuration is just one optionalconfiguration and SOC 70 and the features thereof could be integratedwith the sensor unit 60 in some cases, which is also included in thescope of this disclosure.

In operation, the SOC 70 may acquire data from the various sensors 62,63, 65, 66, 67, 68 at an acquisition rate, and may process the data soas to determine a context of the electronic device 50 relative to itsenvironment. Contexts will be explained in detail.

In operation, the control circuit 64 acquires data from theaccelerometer 63 and/or the gyroscope 62, and processes the data so asto generate a context of the electronic device 50 relative to itssurroundings. This processing is performed by the control circuit 64using a processing technique operating in accordance with programmableconfiguration data. The processed data is then output by the controlcircuit 64 to the SOC 70 for use thereby.

The context of the electronic device 50 may be where on the user's bodyit is carried (i.e. in pocket, in hand, in holster), a current method oflocomotion of the user (i.e. running, walking, driving, bicycling,climbing stairs, riding a train, riding a bus), an orientation of theelectronic device 50 with respect to gravity. Another example contextmay be movement of the electronic device 50 in a gesture, such as a userraising a smartwatch in to a position to view the screen thereof,shaking the electronic device 50, double tapping the touch screen 78 ofthe electronic device 50, rotating the electronic device 50 eitherclockwise or counterclockwise, and swiping the touch screen 78 to theleft, right, top, or bottom.

Motion activities such as walking, jogging, and the like havecharacteristic patterns that are user specific and can vary greatlybetween users. These characteristic patterns be dependent on the height,weight, gender, body proportions (leg length, arm length), and age ofthe user, in addition to a personal style or gait of performing themotion activities. Mobile and wearable devices 50 tend to be personal tothe user and not shared with others. Therefore, it is desirable togenerate a personalized classifier that increases the accuracy of motionactivity classification. Shown in FIG. 2 is a chart illustrating how theuse of a generic classifier may yield inaccurate results, however theuse of a personalized classifier instead yields accurate results. As canbe seen, when using the generic classifier, a diamond shaped marker(representing an instance of a first class) is incorrectly classified asa second class. However, when using the personalized classifier, thisdiamond shaped marker is correctly classified as a first class.

Even though a target user specific classifier designed using that user'smotion activity data would provide for a high degree of accuracy,generating a specific classifier for each target user by explicitlyrequesting samples of each motion activity from the target user (i.e.supervised learning) is impractical. Thus, the Inventor has developed apersonalized classifier which does not explicitly request data samplesof each motion activity from the user to build the personalizedclassifier. The personalized classifier has the advantage of increasedaccuracy as it is able to detect and classify according to the targetuser's specific motion activity patterns. With reference to FIG. 3,generation of a personalized classifier using unsupervised learning isnow described. After initialization of the sensors 62, 63, 65, 66, 67,68 (Block 102), the control circuit 64 uses one or more of the sensors62, 63, 65, 66, 67, 68 to collect a frame of motion activity data (Block104). The control circuit 64 pre-processes the frame of motion activitydata (i.e. performs noise filtering, segmenting, and windowing, furtherdetails of which will be given below), and then computes the posteriorprobabilities of the motion activities of that frame (Block 106) using afactory-set generalized classifier (Block 116). The set of theseprobabilities is called a “posteriorgram”.

The generation of the motion activity posteriorgram is independent ofthe carry position of the electronic device 50 by the user, and can beperformed by the control circuit 64 using a suitable machine learningalgorithm for generating the posteriorgram like Artificial NeuralNetwork (ANN), Recurrent Neural Network (RNN), Hidden Markov Model(HMM), Support Vector Machine (SVM), etc.

Using the posteriorgram, a Data Selection Measure of the classifier'sdetected motion activity (confidence level) is calculated by the controlcircuit 64 (Block 107). The DSM may be calculated using a conditionalentropy function, or as a function of a difference between the highestprobability and second highest probability in the motion activityposteriorgram, or using any other suitable measure.

If the DSM is within a pre-specified range, then the sensor data of thetarget user that was used to calculate the posteriorgram is inducted bythe control circuit 64 into a training database (Block 112). If the DSMis outside of that range, the control circuit 64 discards the sensordata (Block 110).

The threshold or threshold used may be of three types. First, thethreshold could be a lower threshold (T_(L)) such that target user datahaving a DSM higher than the threshold will be stored in the trainingdatabase for use with the personalized classifier training. Second, thethreshold could be an upper threshold (T_(U)) such that target user datahaving a DSM lower than the threshold will be stored in the trainingdatabase for use with the personalized classifier training. In the thirdcase, the thresholds could be a range having a lower threshold (T_(L))and upper threshold (T_(U)) and target user data having a DSM in thespecified range will be stored for use with the personalized classifiertraining.

As shown in FIG. 1A, the training database 82 may be stored innonvolatile memory 80 in the electronic device 50. In some cases, suchas that shown in FIG. 1B, the training database 82 may be stored on anexternal server 81. The training database 82 may include only thecollected data, or in some cases may also include factory-set genericdata.

If there is now a sufficient amount of training data (Block 114), then apersonalized motion activity classifier is generated from the trainingdata (Block 118). The personalized motion activity classifier may begenerated from only training data collected by the sensors 62, 63, 65,66, 67, 68, or from a combination of that training data and factory-setgeneric data. The personalized motion activity classifier may becalculated from scratch, or may be calculated by modifying a factory-setgeneralized motion activity classifier. If there is not yet sufficienttraining data to generate the personalized motion activity classifier,the functions of Block 218 are not performed.

The personalized motion activity classifier, if calculated, may then beused in the calculation of the motion activity posteriorgram forsubsequently acquired frames of data, as will be described withreference to FIG. 4.

The processing of the next frame of motion activity data collected fromthe sensors 62, 63, 65, 66, 67, 68 by the control circuit 64 proceeds asdescribed above, beginning with initialization (Block 202), proceedingto motion activity collection (Block 204), and then motion activityposteriorgram generation (Block 206). Here, the motion activityposteriorgram is calculated using the personalized motion classifier(Block 216). The processing proceeds as described above with the DSMcalculation (Block 207), threshold determination (Block 208), storage ofthe data in the training data set (Block 212), and the data sufficiencycheck (Block 214). Here, if there is sufficient training data to updatethe personalized motion activity classifier, then the personalizedmotion activity classifier is updated (Block 218).

Consequently, it should be understood that this way, the personalizedmotion activity classifier is iteratively trained from a previouslytrained personalized classifier, in an unsupervised learning fashion.The thresholds at any n^(th) iteration may be adaptive and thus may ormay not be equal to the thresholds used for generation of thepersonalized classifier during a previous iteration.

Details of the calculation of the motion activity posteriorgramdescribed above, or any calculations, vectors, or posteriorgramscalculated above, may be found in copending application: U.S. Ser. No.15/074,188, entitled METHOD AND APPARATUS FOR DETERMINING PROBABILISTICCONTEXT AWARENESS OF A MOBILE DEVICE USER USING A SINGLE SENSOR AND/ORMULTI-SENSOR FUSION. This application is hereby incorporated byreference.

Depicted in FIG. 5 is a flowchart 150 describing techniques fordetermining the posterior probabilities for a particular set of humanmotion activities from data obtained from the sensors 62, 63, 65, 66,67, 68.

For illustration purposes, consider the motion activity contexts of auser that are grouped in a motion activity vector: Motion ActivityVector (MAV)=[stationary; walking; jogging; going upstairs; goingdownstairs; elevator up elevator down; bicycling; driving; none ofthese]’.

The MAV is a superset of the activities that may be personalized for thetarget user. The MAV is comprised of nine motion activities of which atleast five motion activities (i.e. walking, jogging, cycling, walkingupstairs, and walking downstairs) may be personalized. The MAV has one“class” or element in each vector that is possible at a given time i.e.,the elements are mutually exclusive and a “none of these” classrepresents the remaining motion activities that are not explicitlyincorporated as elements. This allows the sum total of probability ofthe mathematically relevant elements of a vector to be equal to one.Also, this makes the motion activity vector representation flexible sothat new classes of motion activity can be explicitly incorporated.

The posterior probability of each motion activity given the data fromone or more sensors 62, 63, 65, 66, 67, 68 is the correspondingposteriorgram of the MAV. Let it be named as the Motion ActivityPosteriorgram (MAP).

Samples of the effectiveness of the above techniques will now be given.Data was used for eleven persons, utilizing seven device carry positionsfor nine activities. These activities include walking, cycling,stationary, going upstairs, going downstairs, jogging, in-vehicle,elevator up, and elevator down. The user may carry the device 50 invarious body positions, such as in a trouser pocket, in a backpack,in-hand, in an arm swinging, in a shirt pocket, holstered, and in ashoulder bag, which are used for the data to be presented. Thus, thedata used has wide diversity.

After raw motion activity data is collected from the sensors 62, 63, 65,66, 67, 68 the control circuit 64 performs pre-processing (Block 154)and segments the data into windows. The pre-processing steps are asfollows. The sampling frequency of the accelerometer 63 is 50 Hz, whichis downsampled to 20 Hz. The sampling frequency of the barometer is 67is 20 Hz. The window size is taken as five seconds with a three secondoverlap. Hence, the motion activity classifier is capable of providing adetected motion activity decision every two seconds.

Several time domain and frequency domain features are calculated foreach frame. The time domain features from the accelerometer are mean,maxima, minima, zero crossing rate (ZCR), 10^(th) order linearprediction coefficients (LPC), root mean square (RMS) of theaccelerometer magnitude, and three cumulative plot features. To derivethe cumulative plot features, sorted time domain samples of eachwindowed frame are taken. From the sorted time domain data, thefollowing mean are calculated from the specified data range:

-   -   1. Mean Minima: is defined as the mean of first 15% of the        sorted data of the frame.    -   2. Mean Middle: is defined as the mean of the sorted data of the        frame from 30% to 40%.    -   3. Mean Maxima: is defined as the mean of the sorted data of the        frame from 80% to 95%.

The frequency domain features from the accelerometer 63 are forty nineDFT coefficients, maxima of the DFT magnitude, frequency of maximum DFTmagnitude bin, and energy in six frequency bands where the bands are asfollows: Band 1: 0.2-1 Hz, Band 2: 1-2 Hz, Band 3: 2-3 Hz, Band 4: 3-4Hz, Band 5: 4-5 Hz, and Band 6: 5-7 Hz.

A total of seventeen features in the time domain and ten features in thefrequency domain are calculated for each windowed frame. There are tenfeatures extracted from the barometer data that are the maxima, minima,RMS, six LPC coefficients, and the slope of the pressure variation inthe time window. The above set of features per frame of data from theaccelerometer 63 and barometer 67 are used to model a probabilisticmachine learning algorithm.

Several machine learning algorithms for classification like ANN, HMM,SVM, etc. were implemented, and it was found by the Inventors that aparticularly accurate detection is obtained using the SVM. The basic SVMis a non-probabilistic supervised learning algorithm for binary classes.The SVM generates a separating hyperplane such that the width ofseparation is the maximum. There are several methods that extend SVM formulticlass classification such as maximum wins voting (MWV), winnertakes all (WTA), and directed acyclic graph (DAG). The approach used inthe classifier below is a soft-decision SVM with DAG. DAG is comprisedof several binary classifiers in a tree structure that solves themulticlass classification problem. For M classes of motion activities,there are 0.5*M(M−1) number of binary classifiers between pairs ofclasses that are used. Each binary classifier in the DAG is trained toclassify between a pair of classes. Finally, motion activityposteriorgram for 9 motion activity classes is obtained by normalizingthe probabilities obtained from binary classifiers.

SVMs can use linear as well as nonlinear partitions for classification.A kernel function is used for non-linear classification, and transformsthe features into a higher dimensional space in which they are linearlyseparable with the maximum possible margin. To obtain probabilisticoutput, the SVM is fit into a sigmoid model with two parameters that areobtained using maximum likelihood estimation from the training data set(f_(i), y_(i)), where f_(i) is the set of features from a frame of dataand is the corresponding labelled class.

FIG. 6 shows the motion activity posteriorgram (MAP) as a function offrames, and conditional entropy as the DSM from the MAP for the activity“walking” when the generalized classifier is used for motion activitydetection. The activity “walking” is being performed when the device 50is in the “arm swing” position. The DSM of the detected motion activityis evaluated based on the conditional entropy function. The secondsubplot in the figure shows the conditional entropy as a function ofeach time windowed frame.

FIG. 7 shows the MAP as a function of frames, and using the differencebetween the largest and second largest posterior probability as the DSMfrom the MAP for the activity “walking”.

In FIG. 8, the conditional entropy (third subplot) which is calculatedbased on the MAP obtained from the generalized classifier (firstsubplot) forms the basis of measuring the DSM. The range specified forconditional entropy is 2.4 bits to 2.9 bits.

The data from the accelerometer 63 and barometer 67 which resulted inthe conditional entropy in a pre-specified range is saved and furtherused to update the generalized dataset and form the personalizeddataset. As explained above, using the personalized dataset, theclassifier is again retrained and a personalized classifier is obtained.The second subplot displays the improvement in the MAP after theinduction of personalized data in training of the classifier. Forexample, a MAP of 80 frames is considered for which the motionactivities were detected using the generalized classifier. Out of the 80frames, 65 frames are correctly classified as the activity “walking”.After personalized data of the target user has been used in retrainingthe classifier, 71 frames out of 80 frames are correctly classified. TheMAP obtained using a generalized classifier and the corresponding MAPobtained using the personalized classifier are shown for a section ofthe 80 frames in the first subplot and second subplot respectively. Thisillustrates that a personalized classifier improves the detectionaccuracy of the motion activity class. For this example, as thepersonalized data in the given confidence range is less compared to thegeneralized data for the corresponding activity, the personalized datais used ten multiple times.

The target user's data that lies within the pre-specified DSM range isusually less compared to the generalized dataset, so the target user'sdata is taken in two forms in the personalized dataset, one, in which itis taken once along with the generalized dataset for retraining, andtwo, in which ten multiple copies of the data are used so that the ratioof the target user's data to generalized data increases. The weightedaverage accuracy of the nine motion activities in the both the cases aregiven in FIG. 9. With the personalized dataset for training of themodels, the overall weighted average accuracy for nine motion activitiesincreases by 0.87%, which is a reasonable improvement over the highbaseline accuracy of the generalized classifier. With the increase inoverall weighted average accuracy for the nine motion activities whichare a superset of the motion activities that can be personalized, it isevident that the above methods and techniques improve the overalldetection of motion activities.

The data was evaluated using the “leave one out” approach. The aim ofthe evaluation is to demonstrate the efficacy of the personalizedclassifier. The results are given for seven device carry positions foreach of the eleven users. Out of the nine motion activities for whichdata was collected, five motion activities are candidates for userpersonalization (as stated, walking, jogging, cycling, going upstairs,and going downstairs). The remaining motion activities (i.e. stationary,in vehicle, elevator up, and elevator down) are not user dependent andhence were not included for personalization of the classifier. Theresults shown in FIGS. 10-16 are therefore the weighted average accuracyof five personalized human motion activities while taking the elevenusers as the target user one at a time. FIGS. 10-16 show the detectedaccuracy of the motion activities with the device 50 placed at differentcarry positions by the user. The motion activities are classified usingboth accelerometer 63 and barometer 67 data.

The classification accuracy results obtained show that when a correctuncertain data sample of the target user is included in retraining theclassifier, it leads to an increase in the weighted average accuracy ofdetection of human motion activity. This reaffirms that when the datasamples of the target user that were previously not included in trainingthe classifier for a particular class are now included, then theweighted average accuracy of detection increases. If the data samplesthat produce low conditional entropy are included in the personalizedtraining dataset, the classification accuracy after inclusion of suchdata does not change significantly. As the conditional entropyincreases, it leads to an increase in the uncertainty and theprobability of the samples being wrongly classified increases. Thus, itmay lead to an overall decrease in the weighted average accuracy if thesamples which are wrongly classified are included in training samples.By including the target user's data samples with labels that have adegree of certainty which are not part of the generalized dataset andexcluding the data samples of the target user that have high uncertaintyof the detected activity label, the generalized and personalizedclassifier accuracy based on the conditional entropy in thepre-specified range is increased.

FIG. 9 compares the personalized classifier's performance with thegeneralized classifier's performance for different device carrypositions. The DSM used is that the conditional entropy lies between 2.4bits and 2.9 bits that is obtained for each frame from the posteriorprobabilities of the nine motion activities in the MAV. The increase inweighted average accuracy for the device 50 in the trouser pocketposition is 1.81%, for the in-hand position is 1.88%, in the arm swingposition is 1.12%, and in the shoulder bag position is 0.95%.

FIG. 10 shows the weighted average accuracy of five personalized motionactivities when the device 50 is placed in the trouser pocket. Thetarget user #11 has the minimum detection accuracy amongst the userswhen the generalized classifier is used, and it improves markedly from87.4% to 90.76% after the generalized classifier is transformed to apersonalized classifier. Also, the personalized classifier (for eachuser separately) has caused the weighted average accuracy to increasebetween 2.0% and 2.86% for target users 2, 4, 5 and 6. There is nosignificant improvement in the weighted average accuracy of the fivepersonalized motion activities in the case of target users 1, 7, 9 and10, as they already have a very high classification accuracy with thegeneralized classifier. Thus it may be observed that when the device 50is placed in the trouser pocket position, for the target users, theaccuracy of detecting the true motion activity increases variouslydepending on the individual.

FIG. 11 shows the weighted average accuracy of personalized andgeneralized motion activity classifiers for the device 50 in thebackpack position. Target users 1, 3, 4, 7, 8 and 11 have registeredsignificant increases in the weighted average accuracy for the fivepersonalized motion activities. There is a decrease in the accuracy ofthe personalized classifier for the backpack carry position of thedevice 50 for users 5 and 6. This may be due to the loose location ofthe device 50 in the backpack position.

FIG. 12 shows the weighted average accuracy of personalized andgeneralized motion activity for the device 50 in the in-hand position. Aparticularly useful position for the device 50 when using thepersonalized model is the in-hand position. When the device 50 is in thein-hand position, there is an improvement in classification accuracywith the personalized classifier for all the target users. Also, thereis a large increase in the weighted average accuracy of the fivepersonalized motion activities in the case of users having loweraccuracy with the generalized classifier. It can be observed that thetarget users 3, 10 and 11 who register lower classification accuracyfrom the generalized classifier register a significant increase with theuse of their respective personalized classifiers.

FIG. 13 shows the weighted average accuracy of the personalized andgeneralized motion activity classifiers for device 50 in the arm swingposition. There is a significant increase of more than 7% in theweighted average accuracy in comparison to the generalized model for thetarget users having low accuracy, which are users 1 and 9 in thisexample. The other users also display an increase in the weightedaverage accuracy except users 6 and 11, for whom there is a slightdecrease in the accuracy.

FIG. 14 shows the weighted average accuracy of the personalized andgeneralized motion activity classifiers for the device 50 in the shirtpocket position. In this device carry position, except for target user2, the weighted average accuracy increases (target users 1, 3, 6 and 10)or remains the same (target users 4, 5, 7 and 9). Data was not collectedfor users 4 and 8 for the device 50 in the shirt pocket position andholster position respectively, thus no corresponding detection result isshown.

FIG. 15 shows the weighted average accuracy of the personalized andgeneralized motion activity classifiers for the device 50 in the holsterposition. The personalized classifier for shows an increase in theweighted average accuracy for the five personalized motion activitiesfor target users 1, 3, 6, 7, 9, and 11, and remains the same for targetusers 2, 5, 8 and 10. As the device 50 is placed in a tight holster,close to user's body, it rarely decreases the accuracy of motionactivity detection.

FIG. 16 shows the weighted average accuracy of the personalized andgeneralized motion activity classifiers for the device 50 in theshoulder bag position. When the device 50 is in the shoulder bagposition, it is generally loosely placed. Thus, personalized patternsare difficult to trace in the recorded data of the respective targetusers. However, there is an increase in the weighted average accuracyfor target user 2, 3, 5, 6, 7 and 11, while for target user 10, theweighted average accuracy has decreased.

It may be seen from the results that the methods and techniquesdescribed hereinabove are independent of the device carry position andshow overall improvement in weighted average accuracy. Also, the resultsaffirm that the device carry positions which characterize the user'spersonalized motion patterns in a close manner relative to the devicecarry positions in which the device 50 is loosely held to body show moreimprovement in the classification accuracy. The improvement in accuracyof the device carry positions of trouser pocket, in-hand and holster arebetter than the backpack and shoulder bag carry positions of the device50. The above figures also emphasize the fact that the method would berelatively more useful for the target user having the gait patterndistinct with respect to gait patterns which are used to train thegeneralized classifier.

Although the methods and processing techniques described above have beendescribed with reference to the control circuit 64 performing thoseactions, in some cases, such as shown in FIG. 1C, the control circuitnot be present and instead these actions may be performed by the CPU 72of the SOC 70. Also, in cases, the control circuit 64 may be present,but the CPU 72 of the SOC 70 may perform these actions. In yet othercases, the control circuit 64 and CPU 72 may each perform differentportions of the methods and processing techniques described above.

While the disclosure has been described with respect to a limited numberof embodiments, those skilled in the art, having benefit of thisdisclosure, will appreciate that other embodiments can be envisionedthat do not depart from the scope of the disclosure as disclosed herein.Accordingly, the scope of the disclosure shall be limited only by theattached claims.

The invention claimed is:
 1. A method of operating an electronic device, comprising: collecting initial motion activity data from at least one sensor of the electronic device; generating an initial probabilistic context of the electronic device relative to its surroundings from the initial collected motion activity data using a motion activity classifier function; storing the collected motion activity data in a training data set; updating the motion activity classifier function using the training data set; collecting subsequent motion activity data from the at least one sensor of the electronic device; and generating a subsequent probabilistic context of the electronic device relative to its surroundings from the subsequently collected motion activity data using the updated motion activity classifier function.
 2. The method of claim 1, further comprising generating a data selection confidence measure after generating the initial probabilistic context; wherein the collected motion activity data is stored in the training data set if the data selection confidence measure is greater than a lower threshold, and wherein the collection motion activity data is not stored in the training data set if the data selection confidence measure is less than the lower threshold.
 3. The method of claim 2, wherein the data selection confidence measure is based upon conditional entropy of the initial probabilistic context.
 4. The method of claim 3, wherein the initial probabilistic context comprises a motion activity posteriorgram encompassing multiple different potential contexts; and wherein the data selection confidence measure is based upon conditional entropy of the motion activity posteriorgram.
 5. The method of claim 2, wherein the data selection confidence measure is based upon a difference between highest and second highest of posterior probabilities of motion activities of the probabilistic context.
 6. The method of claim 1, wherein the collected motion activity data is stored in the training data set if the data selection confidence measure is greater than or equal to a lower threshold and less than or equal to an upper threshold.
 7. The method of claim 1, further comprising generating a data selection confidence measure after generating the initial probabilistic context; wherein the collected motion activity data is stored in the training data set if the data selection confidence measure is less than an upper threshold, and wherein the collection motion activity data is not stored in the training data set if the data selection confidence measure is greater than the upper threshold.
 8. The method of claim 1, further comprising determining whether the training data set contains sufficient data prior to updating the motion activity classifier function using the training data set, and not updating the motion activity classifier function unless the training data set contains sufficient data.
 9. The method of claim 1, further comprising: storing the subsequent motion activity data in the training data set; further updating the updated motion activity classifier function using the training data set; collecting further motion activity data from the at least one sensor of the electronic device; and generating a further probabilistic context of the electronic device relative to its surroundings from the further motion activity data using the further updated motion activity classifier function.
 10. The method of claim 1, wherein the training data set includes generalized data and motion activity data collected from the at least one sensor of the electronic device.
 11. The method of claim 1, wherein the training data set consists of motion activity data collected from the at least one sensor of the electronic device.
 12. A sensor chip mounted on a printed circuit board (PCB) and electrically coupled to a system on chip (SOC) mounted on the PCB via at least one conductive trace, the sensor chip comprising: at least one sensing device; and a control circuit configured to: collect initial motion activity data from the at least one sensing device; generate an initial probabilistic context of the printed circuit board relative to its surroundings from the initial collected motion activity data using a motion activity classifier function; store the collected motion activity data in a training data set; update the motion activity classifier function using the training data set; collect subsequent motion activity data from the at least one sensor of the electronic device; and generate a subsequent probabilistic context of the electronic device relative to its surroundings from the subsequently collected motion activity data using the updated motion activity classifier function.
 13. The sensor chip of claim 12, wherein the control circuit outputs the initial probabilistic context and subsequent probabilistic context to the SOC.
 14. The sensor chip of claim 12, wherein the at least one sensing device comprises at least one of an accelerometer, barometer, gyroscope, magnetometer, microphone, and GPS.
 15. The sensor chip of claim 12, wherein the control circuit is further configured to generate a data selection confidence measure after generating the initial probabilistic context; wherein control circuit stored the collected motion activity data in the training data set if the data selection confidence measure is greater than a lower threshold, and does not store the collection motion activity data in the training data set if the data selection confidence measure is less than the lower threshold.
 16. The sensor chip of claim 15, wherein the control circuit stores the collected motion activity data in the training data set if the data selection confidence measure is greater than or equal to a lower threshold and less than or equal to an upper threshold.
 17. The sensor chip of claim 15, wherein the control circuit is further figured to generate a data selection confidence measure after generating the initial probabilistic context; and wherein the control circuit is configured to store the collected motion activity data in the training data set if the data selection confidence measure is less than an upper threshold, and to not store the collection motion activity data in the training data set if the data selection confidence measure is greater than the upper threshold.
 18. The sensor chip of claim 12, wherein the control circuit is further configured to determine whether the training data set contains sufficient data prior to updating the motion activity classifier function using the training data set, and to not update the motion activity classifier function unless the training data set contains sufficient data.
 19. A method of operating an electronic device, comprising: collecting motion activity data from at least one sensor of the electronic device; generating probabilistic context of the electronic device relative to its surroundings from the collected motion activity data using a motion activity classifier function; storing the collected motion activity data in a training data set; updating the motion activity classifier function using the training data set; and updating the probabilistic context of the electronic device relative to its surroundings using the updated motion activity classifier function.
 20. The method of claim 19, further comprising generating a data selection confidence measure after generating the probabilistic context; wherein the collected motion activity data is stored in the training data set if the data selection confidence measure is greater than a lower threshold, and wherein the collection motion activity data is not stored in the training data set if the data selection confidence measure is less than the lower threshold.
 21. The method of claim 20, wherein the collected motion activity data is stored in the training data set if the data selection confidence measure is greater than or equal to a lower threshold and less than or equal to an upper threshold.
 22. The method of claim 19, further comprising generating a data selection confidence measure after generating the probabilistic context; wherein the collected motion activity data is stored in the training data set if the data selection confidence measure is less than an upper threshold, and wherein the collection motion activity data is not stored in the training data set if the data selection confidence measure is greater than the upper threshold. 